export default{
    state: {
        status:'matching',//控制匹配界面和对战界面playing
        socket:null,
        opponent_username:'我的对手',
        opponent_photo:"https://cdn.acwing.com/media/article/image/2022/08/09/1_1db2488f17-anonymous.png",
        gameMap:null,
        a_id:0,
        a_sx:0,
        a_sy:0,
        b_id:0,
        b_sx:0,
        b_sy:0,
        gameObject:null,
        loser:"none" //all、A、 B
    },
    getters: {
    },
    mutations: {
        UpdateSocket(state,socket){
            state.socket = socket;
        },
        UpdateOpponent(state,opponent){
            state.opponent_username = opponent.username;
            state.opponent_photo = opponent.photo;
        },
        UpdateStatus(state,status){
            state.status = status;
        },
        UpdateGameMap(state,game){
            state.gameMap = game.gameMap;
            state.a_id = game.a_id;
            state.a_sx = game.a_sx;
            state.a_sy = game.a_sy;
            state.b_id = game.b_id;
            state.b_sx = game.b_sx;
            state.b_sy = game.b_sy;
        },
        UpdateGameObject(state,gameObject){
            state.gameObject = gameObject;
        },
        UpdateLoser(state,loser){
            state.loser = loser;
        }
    },
    actions: {
    },
    modules: {
    }
}